home *** CD-ROM | disk | FTP | other *** search
Wrap
<refentry id="GimpFileSelection" revision="19 Jan 2001"> <refmeta> <refentrytitle>GimpFileSelection</refentrytitle> <manvolnum>3</manvolnum> <refmiscinfo>LIBGIMP Library</refmiscinfo> </refmeta> <refnamediv> <refname>GimpFileSelection</refname><refpurpose>Widget for entering a filename.</refpurpose> </refnamediv> <refsynopsisdiv><title>Synopsis</title> <synopsis> struct <link linkend="GimpFileSelection-struct">GimpFileSelection</link>; #define <link linkend="GIMP-FILE-SELECTION-CAPS">GIMP_FILE_SELECTION</link> (obj) <link linkend="GtkWidget">GtkWidget</link>* <link linkend="gimp-file-selection-new">gimp_file_selection_new</link> (const <link linkend="gchar">gchar</link> *title, const <link linkend="gchar">gchar</link> *filename, <link linkend="gboolean">gboolean</link> dir_only, <link linkend="gboolean">gboolean</link> check_valid); <link linkend="gchar">gchar</link>* <link linkend="gimp-file-selection-get-filename">gimp_file_selection_get_filename</link> (<link linkend="GimpFileSelection">GimpFileSelection</link> *gfs); void <link linkend="gimp-file-selection-set-filename">gimp_file_selection_set_filename</link> (<link linkend="GimpFileSelection">GimpFileSelection</link> *gfs, const <link linkend="gchar">gchar</link> *filename); </synopsis> </refsynopsisdiv> <refsect1> <title>Object Hierarchy</title> <synopsis> <link linkend="GtkObject">GtkObject</link> +----<link linkend="GtkWidget">GtkWidget</link> +----<link linkend="GtkContainer">GtkContainer</link> +----<link linkend="GtkBox">GtkBox</link> +----<link linkend="GtkHBox">GtkHBox</link> +----GimpFileSelection </synopsis> </refsect1> <refsect1> <title>Signal Prototypes</title> <synopsis> "<link linkend="GimpFileSelection-filename-changed">filename-changed</link>" void user_function (<link linkend="GimpFileSelection">GimpFileSelection</link> *gimpfileselection, <link linkend="gpointer">gpointer</link> user_data); </synopsis> </refsect1> <refsect1> <title>Description</title> <para> This widget is used to enter filenames or directories. </para> <para> There is a <link linkend="GtkEntry">GtkEntry</link> for entering the filename manually and a "..." button which will pop up a <link linkend="GtkFileSelection">GtkFileSelection</link> dialog. </para> <para> You can restrict the <link linkend="GimpFileSelection">GimpFileSelection</link> to directories. In this case the filename listbox of the <link linkend="GtkFileSelection">GtkFileSelection</link> dialog will be hidden. </para> <para> If you specify <parameter>check_valid</parameter> as <link linkend="TRUE-CAPS">TRUE</link> in <link linkend="gimp-file-selection-new">gimp_file_selection_new</link>() the entered filename will be checked for validity and a pixmap will be shown which indicates if the file exists or not. </para> <para> Whenever the user changes the filename, the "filename_changed" signal will be emitted. </para> </refsect1> <refsect1> <title>Details</title> <refsect2> <title><anchor id="GimpFileSelection-struct">struct GimpFileSelection</title> <programlisting>struct GimpFileSelection;</programlisting> <para> </para></refsect2> <refsect2> <title><anchor id="GIMP-FILE-SELECTION-CAPS">GIMP_FILE_SELECTION()</title> <programlisting>#define GIMP_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_FILE_SELECTION, GimpFileSelection)) </programlisting> <para> Checks if the passed pointer is a pointer to a <link linkend="GimpFileSelection">GimpFileSelection</link> and performs the cast if valid. </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>obj</parameter> :</entry> <entry>The pointer to cast. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-file-selection-new">gimp_file_selection_new ()</title> <programlisting><link linkend="GtkWidget">GtkWidget</link>* gimp_file_selection_new (const <link linkend="gchar">gchar</link> *title, const <link linkend="gchar">gchar</link> *filename, <link linkend="gboolean">gboolean</link> dir_only, <link linkend="gboolean">gboolean</link> check_valid);</programlisting> <para> Creates a new <link linkend="GimpFileSelection">GimpFileSelection</link> widget.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>title</parameter> :</entry> <entry> The title of the <link linkend="GtkFileSelection">GtkFileSelection</link> dialog. </entry></row> <row><entry align="right"><parameter>filename</parameter> :</entry> <entry> The initial filename. </entry></row> <row><entry align="right"><parameter>dir_only</parameter> :</entry> <entry> <link linkend="TRUE-CAPS">TRUE</link> if the file selection should accept directories only. </entry></row> <row><entry align="right"><parameter>check_valid</parameter> :</entry> <entry> <link linkend="TRUE-CAPS">TRUE</link> if the widget should check if the entered file really exists. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> A pointer to the new <link linkend="GimpFileSelection">GimpFileSelection</link> widget. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-file-selection-get-filename">gimp_file_selection_get_filename ()</title> <programlisting><link linkend="gchar">gchar</link>* gimp_file_selection_get_filename (<link linkend="GimpFileSelection">GimpFileSelection</link> *gfs);</programlisting> <para> Note that you have to <link linkend="g-free">g_free</link>() the returned string.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>gfs</parameter> :</entry> <entry> The file selection you want to know the filename from. </entry></row> <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The file or directory the user has entered. </entry></row> </tbody></tgroup></informaltable></refsect2> <refsect2> <title><anchor id="gimp-file-selection-set-filename">gimp_file_selection_set_filename ()</title> <programlisting>void gimp_file_selection_set_filename (<link linkend="GimpFileSelection">GimpFileSelection</link> *gfs, const <link linkend="gchar">gchar</link> *filename);</programlisting> <para> If you specified <parameter>check_valid</parameter> as <link linkend="TRUE-CAPS">TRUE</link> in <link linkend="gimp-file-selection-new">gimp_file_selection_new</link>() the <link linkend="GimpFileSelection">GimpFileSelection</link> will immediately check the validity of the file name.</para> <para> </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>gfs</parameter> :</entry> <entry> The file selection you want to set the filename for. </entry></row> <row><entry align="right"><parameter>filename</parameter> :</entry> <entry> The new filename. </entry></row> </tbody></tgroup></informaltable></refsect2> </refsect1> <refsect1> <title>Signals</title> <refsect2><title><anchor id="GimpFileSelection-filename-changed">The "filename-changed" signal</title> <programlisting>void user_function (<link linkend="GimpFileSelection">GimpFileSelection</link> *gimpfileselection, <link linkend="gpointer">gpointer</link> user_data);</programlisting> <para> This signal is emitted whenever the user changes the filename. </para><informaltable pgwide=1 frame="none" role="params"> <tgroup cols="2"> <colspec colwidth="2*"> <colspec colwidth="8*"> <tbody> <row><entry align="right"><parameter>gimpfileselection</parameter> :</entry> <entry>the object which received the signal. </entry></row> <row><entry align="right"><parameter>user_data</parameter> :</entry> <entry>user data set when the signal handler was connected.</entry></row> </tbody></tgroup></informaltable></refsect2> </refsect1> <refsect1> <title>See Also</title> <para> <link linkend="GimpPathEditor">GimpPathEditor</link> </para> </refsect1> </refentry>